<?php

/**
 * [PHPFOX_HEADER]
 */
defined('PHPFOX') or exit('NO DICE!');

/**
 * 
 * 
 * @copyright		[PHPFOX_COPYRIGHT]
 * @author  		Raymond Benc
 * @package 		Phpfox_Service
 * @version 		$Id: process.class.php 4977 2012-10-31 14:12:43Z Miguel_Espinoza $
 */
class Marketplace_Service_Store_Album extends Phpfox_Service {
    
    public function __construct() {
        $this->_sTable = Phpfox::getT('marketplace_album');
    }

    public function create($sName){
        $iId = $this->database()->insert($this->_sTable,array(
            "title" => $sName,
            'user_id' => Phpfox::getUserId()
        ));
        
        return $iId;
    }
    
    public function get($iUserId){
        $aAlbums = $this->database()->select("*")
                ->from($this->_sTable)
                ->where("user_id = ".$iUserId)
                ->execute("getRows");
        
        return $aAlbums;
    }
}
?>
